/***
 * 分页js
 */
var _callback;
var _param;
var pageNo=1;
var pageSize=5;
function fenye(ele,data,callback) {
    layui.use('laypage', function(){
        var laypage = layui.laypage;
        //执行一个laypage实例
        laypage.render({
            elem: ele
            ,count: data.size
            ,limits:[10, 20, 30, 40, 50,100]
            ,layout: ['count','prev', 'page', 'next', 'limit', 'skip']
            ,jump: function(obj,first){
                if(!first){
                    _callback = callback;
                    _param=obj;
                    doIt();
                }
            }
        });
    });
}

function doIt(){
    _callback(_param);
}

/***
 * alert提示
 * @param msg
 */
function showalert(msg,flush) {
    layui.use('layer', function() {
        var layer = layui.layer;
        layer.open({
            title: '提示信息'
            ,content: msg,
            btn:"我知道了",
            yes:function(index, layero){
            	if(flush==true){
            		window.location.reload();
            	}else{
            		layer.close(layer.index);
            	}
            	
            	
            }
        });
    })
}

/***
 * confirm提示
 * @param msg
 */
function showconfirm(msg,callback,param) {
    layui.use('layer', function() {
        var layer = layui.layer;
        layer.open({
            title: '提示信息',
            content: msg,
            btn:['确定', '取消'],
            yes:function(index, layero){
		    	//按钮【按钮一】的回调
		    	
                //_param=obj;
                console.log(param)
                callback(param);
                //doIt();
		  	},
		  	cancel: function(){ 
			    
			}
        });
    })
}

/***
 * 接口api地址
 */
function reapi(){
	var test="http://127.0.0.1:9090/dfzqapitest";
	var zhengshi="http://192.168.137.1:8080/ssm";
	return test
}

/***
 * 返回状态提示信息
 * @param {Object} data
 * @param {Object} suc
 * @param {Object} ero
 */
function message(data,suc,ero){
	if(data.status=="10000"){
		showalert(suc)
	}else{
		showalert(ero)
	}
}

